﻿using Microsoft.SharePoint;
using T2V.SharePoint.Report.DocXGenerator;


namespace Pesico.Forms.DocxGenerator
{
    public class ContractDataContext : DataContextBase
    {
        public string CompanyA { get; set; }
        public string AddressA { get; set; }
        public string AccountA { get; set; }
        public string PhoneNumberA { get; set; }
        public string FaxA { get; set; }
        public string RepresentativeA { get; set; }

        public string CompanyB { get; set; }
        public string AddressB { get; set; }
        public string AccountB { get; set; }
        public string PhoneNumberB { get; set; }
        public string FaxB { get; set; }
        public string RepresentativeB { get; set; }

        public ContractDataContext(SPListItem item): base(item)
        {
            if (item["CompanyA"] != null)
                CompanyA = item["CompanyA"].ToString();
            else
                CompanyA = string.Empty;

            if (item["AddressA"] != null)
                AddressA = item["AddressA"].ToString();
            else
                AddressA = string.Empty;

            if (item["AccountA"] != null)
                AccountA = item["AccountA"].ToString();
            else
                AccountA = string.Empty;

            if (item["PhoneNumberA"] != null)
                PhoneNumberA = item["PhoneNumberA"].ToString();
            else
                PhoneNumberA = string.Empty;

            if (item["FaxA"] != null)
                FaxA = item["FaxA"].ToString();
            else
                FaxA = string.Empty;

            if (item["RepresentativeA"] != null)
                RepresentativeA = item["RepresentativeA"].ToString();
            else
                RepresentativeA = string.Empty;

            if (item["CompanyB"] != null)
                CompanyB = item["CompanyB"].ToString();
            else
                CompanyB = string.Empty;

            if (item["AddressB"] != null)
                AddressB = item["AddressB"].ToString();
            else
                AddressB = string.Empty;

            if (item["AccountB"] != null)
                AccountB = item["AccountB"].ToString();
            else
                AccountB = string.Empty;

            if (item["PhoneNumberB"] != null)
                PhoneNumberB = item["PhoneNumberB"].ToString();
            else
                PhoneNumberB = string.Empty;

            if (item["FaxB"] != null)
                FaxB = item["FaxB"].ToString();
            else
                FaxB = string.Empty;

            if (item["RepresentativeB"] != null)
                RepresentativeB = item["RepresentativeB"].ToString();
            else
                RepresentativeB = string.Empty;
            
        }
    }
}
